home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / video / simpleVideo / examples / svtest7.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  1.7 KB  |  59 lines

  1. /*
  2.  * Copyright (c) 1994, Silicon Graphics, Inc.
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and
  5.  * its documentation for any purpose is hereby granted without fee, provided
  6.  * that the name of Silicon Graphics may not be used in any advertising or
  7.  * publicity relating to the software without the specific, prior written
  8.  * permission of Silicon Graphics.
  9.  *
  10.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
  11.  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
  12.  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  13.  *
  14.  * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
  15.  * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
  16.  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE
  17.  * POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN
  18.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  19.  */
  20. /* $Id: svtest7.c,v 1.2 1994/04/29 22:55:44 dpb Exp $ */
  21.  
  22. /*** Continuous transfer of frames from vino to galileo;
  23.  *** Use discrete transfers, rgb images;
  24.  ***/
  25.  
  26. #include <stdio.h>
  27. #include <unistd.h>
  28. #include "sv.h"
  29.  
  30. int
  31. main(void)
  32. {
  33.     int ret;
  34.     svImage *imageInfo;
  35.     svContext context1, context2;
  36.  
  37.     context1 = svCurrentContext();
  38.     svSelectInput(vnINPUT_INDYCAM);
  39.     svSetFrameCount(2);
  40.  
  41.     context2 = svNewContext();
  42.     svSelectOutput(gvOUTPUT_ANALOG);
  43.     svSetFrameCount(2);
  44.  
  45.     imageInfo = svNewImage();
  46.  
  47.     while (1) {
  48.     svSetContext(context1);
  49.     if (ret = svGetFrame(imageInfo))
  50.         printf("svGetFrame returns %d\n", ret);
  51.  
  52.     svSetContext(context2);
  53.     if (ret = svPutFrame(imageInfo))
  54.         printf("svPutFrame returns %d\n", ret);
  55.     }
  56.  
  57.     return 0;
  58. }
  59.